<?php
	session_start();
	include_once("./stdlib.php");
	include_once("./config.php");
	include_once("./Servicios/Util/Conexion.php");
	include_once("./Servicios/Util/Propiedad.php");
	include_once("./Servicios/Util/Fecha.php");
	include_once("./Servicios/Util/Hora.php");
	include_once("./Servicios/Util/Foto.php");
	include_once("./Servicios/Persona/Direccion.php");
	include_once("./Servicios/Persona/Telefono.php");
	include_once("./Servicios/Persona/Persona.php");
	include_once("./Servicios/Sucursales/Sucursal.php");
	include_once("./Servicios/Usuarios/Usuario.php");
	include_once("./Servicios/Usuarios/Session.php");
	include_once("./Servicios/Persona/Email.php");

	$sesion=new Session();
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Enlace Admin1</title>
<link rel="stylesheet" type="text/css" href="ext3/resources/css/ext-all.css" />
<link rel="stylesheet" id="theme" type="text/css" href="<?php echo $sesion->getTema();?>">
<link rel="stylesheet" type="text/css" href="css/index.css" />

    <script type="text/javascript" src="ext3/adapter/ext/ext-base.js"></script>
    <!-- ENDLIBS -->

    <script type="text/javascript" src="ext3/ext-all.js"></script>
  	<!--script type="text/javascript" src="ext3/ext-all-debug.js"></script-->
  	<script type="text/javascript" src="ext3/src/locale/ext-lang-es.js"></script>

<!-- UTIL-->
<script type="text/javascript" src="enlace.js"></script>

<?php /*





*/?>


<script type="text/javascript" >



var onloadFunction= function (){
			Ext.form.Field.prototype.msgTarget = 'side';
			Ext.fly('cargando').remove();
			Ext.fly('cargando-mask').fadeOut({remove:true});

		<?php

				if(!isset($_SESSION['ss_usuario'])){
		?>
					Ext.getBody().update(joshua.HtmlLogin).fadeIn({
							    endOpacity: 1,
							    easing: 'easeOut',
							    duration: .5
							});
					new joshua.Login.Form({
						renderTo:'login-form'
					});
					//joshua.Reloj.stopAll();

		<?php
				}
				else{
		?>		joshua.InfoUser="<?php echo $sesion->getId().'('.$sesion->sucursal->getNombre().')';?>";
				joshua.login="<?php echo ucfirst( $sesion->getId());?>";
				joshua.foto="img/avatars/<?php echo $sesion->getFoto();?>";
                                joshua.wins="<?php echo $sesion->getWins();?>";
                                joshua.hidden=<?php echo $sesion->getHiddenComponentes();?>;
				joshua.IniciarEscritorio();
		<?php
				}
		?>

}


	Ext.onReady(function (){
		setTimeout(onloadFunction,800);
	}
	);
</script>

		<body scroll="no">
<!-- loading mask -->
						<div id="cargando-mask"></div>
						<div id="cargando">
						  <div class="cargando-indicator">
						   Espere por favor...
						  <br /><span id="cargando-msg">Cargando componentes gr&aacute;ficos...</span>
						  </div>
						</div>

		</body>
</html>
